<template>
  <div class="evaluate">
    <van-collapse v-model="activeNames">
      <van-collapse-item :title="item.nickname" :name="item.id" v-for="(item,index) in scoringList" :key="index">
        <div class="list-title">得分：{{item.scoring_num}}</div>
        <div class="list-title">评语：{{item.comment}}</div>
      </van-collapse-item>
    </van-collapse>
  </div>
</template>
<script>
import notFind from "@/view/common/notFind";
import { getdate } from "@/utils/utils";
import { Collapse, CollapseItem, Toast} from 'vant';
export default {
  name: "evaluate",
  components: {
    notFind, [Collapse.name]: Collapse, [CollapseItem.name]: CollapseItem
  },
  data() {
    return {
      activeNames: [],
      scoringList: [],
    };
  },
  filters: {
    dateFrom(e) {
      if (!e) return '';
      return getdate(e);
    }
  },
  mounted() {
    this.signupId=this.$route.query.signupId;
    this.initAjaxMethod();
  },
  methods: {
    //列表加载
    initAjaxMethod() {
      Toast.loading({ message: "加载中...", forbidClick: true });
      this.$http
        .post(this.$API.SCORING_LIST,{signup_id:this.signupId})
        .then((res) => {
          Toast.clear();
          if (res.code == 1) {
            let list = Array.isArray(res.data) ? res.data : [];
            this.scoringList=list;
            this.activeNames=list.map(o=>o.id)
          }
        });
    }
  },
};
</script>
<style lang="less">
.evaluate {
  padding:0.2rem;
  .list-title{
    padding:0.15rem 0;
    font-size: 0.3rem;
    color:#333;
    line-height: 0.4rem;
  }
}
</style>